Skip to content

feat(contractor-invoices): support skipping a scheduled invoice and previewing a draft invoice PDF - #1265

Open
cammellos wants to merge 2 commits into
mainfrom
feat/contractor-invoice-skip-and-preview
Open

feat(contractor-invoices): support skipping a scheduled invoice and previewing a draft invoice PDF#1265
cammellos wants to merge 2 commits into
mainfrom
feat/contractor-invoice-skip-and-preview

Conversation

@cammellos

Copy link
Copy Markdown
Collaborator

Summary

Wires the SDK up to the two new eor_web capabilities from tiger MR !92157:

  • Skip an existing invoice scheduleSkipInvoiceScheduleButton cancels the schedule loaded on the create_invoice_schedule step (PATCH .../contractor-invoice-schedules/:id with status: "deleted") and returns the wizard to the invoice_schedule step.
  • Preview a contractor invoicePreviewInvoiceButton generates a draft (non-persisted) PDF preview from the current, unsaved create_invoice_schedule form values via the new POST /employments/:id/contractor-invoices/preview endpoint.

Neither capability existed in the SDK before this, including in the generated OpenAPI client — those bindings are hand-added in src/client/{sdk.gen.ts,types.gen.ts,index.ts} (matching hey-api's output shape) from a spec generated locally via mix eorapidocs against the rebased backend branch, since the backend MR hasn't merged/deployed yet. This should be reconciled with a full client regeneration (npm run openapi-ts) once !92157 is deployed to production.

Context

This builds on Gabriel's merged two-step invoice-schedule flow (invoice_schedule + create_invoice_schedule, create/update/prefill). A separate, now-superseded branch (#1251) attempted an earlier single-step version of this work before that flow existed — closed in favor of this, built cleanly on top of the current main.

Test plan

  • New unit tests for buildInvoicePreviewPayload (tests/utils.test.ts)
  • New integration tests in ContractorOnboarding.test.tsx: skip flow, preview flow (asserting the request omits periodicity/nr_occurrences), and error-path field-error surfacing
  • Full suite green, tsc --noEmit, oxlint, oxfmt clean
  • Manual check in example/src/ContractorOnboarding.tsx against a locally running tiger backend

…reviewing a draft invoice PDF

Wires the SDK up to the two new eor_web capabilities from tiger MR !92157:
skipping an existing invoice schedule (PATCH status: deleted) and previewing
a contractor invoice as a draft PDF before it's created. Neither existed in
the SDK before this, including in the generated OpenAPI client — those
bindings are hand-added here (matching hey-api's output shape) from a spec
generated locally via `mix eorapidocs` against the rebased backend branch,
since the backend MR hasn't merged/deployed yet.
@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

Metric Current Previous Change Status
Total (gzip) 259.18 kB 257.42 kB +1.76 kB (+0.7%) 🔴
Total (raw) 693.63 kB 689.62 kB +4.01 kB (+0.6%) 🔴
CSS (gzip) 21.69 kB 21.69 kB 0 B (0%) 🟢
CSS (raw) 112.77 kB 112.77 kB 0 B (0%) 🟢

Size Limits

  • ✅ Total gzipped: 259.18 kB / 350 kB (74.1%)
  • ✅ Total raw: 693.63 kB / 850 kB (81.6%)
  • ✅ CSS gzipped: 21.69 kB / 25 kB (86.8%)

Largest Files (Top 5)

  1. chunk-AUPAAQUT.js - 14 kB (0 B (0%))
  2. styles.css - 10.85 kB (0 B (0%))
  3. index.css - 10.85 kB (0 B (0%))
  4. index.js - 6.79 kB (+16 B (+0.2%))
  5. chunk-KDHFTLCW.js - 6.58 kB (new)
View All Files (421 total)
File Size (gzip) Change
chunk-AUPAAQUT.js 14 kB 0 B (0%)
styles.css 10.85 kB 0 B (0%)
index.css 10.85 kB 0 B (0%)
index.js 6.79 kB +16 B (+0.2%)
chunk-KDHFTLCW.js 6.58 kB new
chunk-D6G3ZRDQ.js 6.43 kB new
chunk-VQEJRNLZ.js 5.82 kB new
chunk-C4HFMTSB.js 5.33 kB 0 B (0%)
chunk-P2YLLK6M.js 4.65 kB new
chunk-MKOMDNWM.js 4.22 kB new

✅ Bundle size check passed

@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

📊 Coverage Report

✅ Coverage increased! 🎉

Metric Current Previous Change Status
Lines 85.48% 85.44% +0.03% 🟢
Statements 85.04% 85.00% +0.04% 🟢
Functions 83.70% 83.66% +0.03% 🟢
Branches 76.89% 76.89% 0%

Detailed Breakdown

Lines Coverage
  • Covered: 4355 / 5095
  • Coverage: 85.48%
  • Change: +0.03% (64 lines)
Statements Coverage
  • Covered: 4428 / 5207
  • Coverage: 85.04%
  • Change: +0.04% (64 statements)
Functions Coverage
  • Covered: 1155 / 1380
  • Coverage: 83.70%
  • Change: +0.03% (13 functions)
Branches Coverage
  • Covered: 2699 / 3510
  • Coverage: 76.89%
  • Change: 0% (20 branches)

✅ Coverage check passed

@github-actions

Copy link
Copy Markdown
Contributor

Deploy preview for adp-cost-calculator ready!

Project:adp-cost-calculator
Status: ✅  Deploy successful!
Preview URL:https://adp-cost-calculator-b11kfqzun-remotecom.vercel.app
Latest Commit:278e771

Deployed with vercel-action

@github-actions

Copy link
Copy Markdown
Contributor

Deploy preview for remote-flows ready!

Project:remote-flows
Status: ✅  Deploy successful!
Preview URL:https://remote-flows-1bsz69cvt-remotecom.vercel.app
Latest Commit:278e771

Deployed with vercel-action

…v auth fallback

fetchAccessToken() required an interactively-obtained VITE_REFRESH_TOKEN even
for VITE_REMOTE_GATEWAY=local, where no such token exists; falls back to the
same JWT-bearer flow fetchCompanyManagerToken() already uses via VITE_USER_ID.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant